package uaiContacts.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Droog
 */
@Entity
@Table(name = "tb_ebd", catalog = "sistema_ipi", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ebd.findAll", query = "SELECT e FROM Ebd e"),
    @NamedQuery(name = "Ebd.findByIdEbd", query = "SELECT e FROM Ebd e WHERE e.idEbd = :idEbd")})
public class Ebd implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_ebd", nullable = false)
    private Integer idEbd;
    @JoinColumn(name = "id_igreja", referencedColumnName = "id_igreja", nullable = false)
    @ManyToOne(optional = false)
    private DadosIgreja idIgreja;
    @JoinColumn(name = "id_membro", referencedColumnName = "id_membro", nullable = false)
    @ManyToOne(optional = false)
    private Membro idMembro;
    @JoinColumn(name = "id_turma", referencedColumnName = "id_turma", nullable = false)
    @ManyToOne(optional = false)
    private TurmaEbd idTurma;

    public Ebd() {
    }

    public Ebd(Integer idEbd) {
        this.idEbd = idEbd;
    }

    public Integer getIdEbd() {
        return idEbd;
    }

    public void setIdEbd(Integer idEbd) {
        this.idEbd = idEbd;
    }

    public DadosIgreja getIdIgreja() {
        return idIgreja;
    }

    public void setIdIgreja(DadosIgreja idIgreja) {
        this.idIgreja = idIgreja;
    }

    public Membro getIdMembro() {
        return idMembro;
    }

    public void setIdMembro(Membro idMembro) {
        this.idMembro = idMembro;
    }

    public TurmaEbd getIdTurma() {
        return idTurma;
    }

    public void setIdTurma(TurmaEbd idTurma) {
        this.idTurma = idTurma;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEbd != null ? idEbd.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ebd)) {
            return false;
        }
        Ebd other = (Ebd) object;
        if ((this.idEbd == null && other.idEbd != null) || (this.idEbd != null && !this.idEbd.equals(other.idEbd))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Ebd[ idEbd=" + idEbd + " ]";
    }
    
}